//package com.doit.day02
//
//import scala.io.Source
//import scala.util.Sorting
//
////类和构造器交织在一起
//class MyScalaIterator extends Iterator[Hero]{
//  //直接在这边读就可以了
//  val lines: Iterator[String] = Source.fromFile("data/input/sanguo.txt").getLines()
//  override def hasNext: Boolean = lines.hasNext
//  override def next(): Hero = {
//    val line: String = lines.next()
//    val arr: Array[String] = line.split(":")
//    //60_120,蜀国
//    val arr1: Array[String] = arr(1).split("_")
//    //120,蜀国
//    val arr2: Array[String] = arr1(1).split(",")
//    new Hero(arr(0),arr1(0).toDouble,arr2(0).toDouble,arr2(1))
//  }
//}
//
//object Test1{
//  def main(args: Array[String]): Unit = {
//    new ScalaOrder(1,1,1,"001",1,1)
//
//    val orders: Array[ScalaOrder] = Array(
//      ScalaOrder(1, 1, 1, "001", 1, 1),
//      ScalaOrder(2, 2, 2, "002", 2, 2),
//      ScalaOrder(3, 3, 3, "003", 3, 3),
//      ScalaOrder(4, 4, 4, "004", 4, 4),
//      ScalaOrder(5, 5, 5, "005", 5, 5),
//      ScalaOrder(6, 6, 6, "006", 6, 6)
//    )
//
//    Sorting.quickSort(orders)(new Ordering[ScalaOrder] {
//      override def compare(x: ScalaOrder, y: ScalaOrder) = y.goods_num - x.goods_num
//    })
//
//    val ints: Array[Int] = Array(1, 2, 3, 4, 6, 5)
//    Sorting.quickSort(ints)
//
//    for (elem <- orders) {
//      println(elem)
//    }
//
//
//  }
//}
